Floating point type digital signal reversible encoding method, decoding method, devices for them, and programs for them

ABSTRACT

Digital signal samples X in a floating-point format, each of which is composed of 1 bit of sign, 8 bits of exponent E and 23 bits of mantissa M, are converted through rounding by an integer formatting part  12  into digital signal samples Y in an integer format, the sequence of the digital signal samples Y is losslessly compression-coded by a compressing part  13  into a code sequence Ca, and the code sequence Ca is output. The digital signal samples Y are converted by a floating point formatting part  15  into digital signal samples X′ in the floating-point format, a difference signal ΔX indicating the difference between the digital signal sample X′ and the digital signal sample X is determined by a subtraction part  16 , the difference signal ΔX is losslessly coded, and the resulting code sequence Cb is output.

TECHNICAL FIELD

The present invention relates to a coding method for compressing adigital sound, music or image signal into codes of smaller informationquantity, a corresponding decoding method, a coding apparatus therefor,a decoding apparatus therefor, and programs therefor.

BACKGROUND ART

As a method for compressing sound or image information, there is known alossless coding method that involves no distortion.

Highly compressive lossless data compression can be achieved bycombining a highly compressive lossy coding and a lossless compressionof the difference between the reproduced signal and the original signalthat appear in the lossy coding. Such a combined compression method hasbeen proposed in Japanese Patent Application Kokai Publication No.2001-44847. This method, which is described in detail in the patentliterature, will be described briefly below.

In a coder, a frame forming part successively separates digital inputsignals (referred to also as an input signal sample sequence) intoframes, each of which is composed of 1024 input signal samples, forexample, and the digital signals are lossily compression-coded on theframe basis. This coding can be based on any format that is suitable forthe input digital signal and can reproduce the original digital inputsignal with a certain fidelity by decoding. For example, if the digitalinput signal is a sound signal, a speech coding recommended according toITU-T recommendation G.729 can be used. If the digital input signal is amusic signal, a transform-domain weighted interleaved vectorquantization (Twin VQ) coding used in MPEG-4 can be used. The codesresulting from the lossy compression coding are locally decoded, and adifference signal that represents the difference between the locallydecoded signal and the original digital signal is produced. Actually,however, there is no need of local decoding, and the difference betweenthe original digital signal and a quantized signal resulting during thelossy compression coding can be determined. The amplitude of thedifference signal is typically much smaller than that of the originaldigital signal. Thus, the quantity of information can be reduced by thelossless compression coding of the difference signal, compared with thelossless compression coding of the original digital signal.

To enhance the efficiency of the lossless compression coding, from eachof the samples in the sample sequence frame of the difference signal inthe sign and magnitude notation (a binary number of sign and magnitude),the MSB, the second MSB, . . . , and the LSB are extracted, and theMSBs, the second MSBs, . . . , and the LSBs are each linked along thesample sequence (that is, the time series), thereby forming therespective bit sequences. In other words, the bit arrangement ischanged. For convenience, the bit sequence composed of linked 1024 bitsat the equal bit position is referred to as a “coordinate bit sequence”.On the other hand, a one-word bit sequence representing the amplitudevalue including the sign of each sample is referred to as an “amplitudebit sequence”, for convenience. The difference signal has a smallamplitude, and therefore, the most significant bit is, or the mostsignificant bit and the following plural bits are, often all “0”. Thecoordinate bit sequence formed by linking the bits at such a bitposition is a bit sequence of “0”. Therefore, the coordinate bitsequence can be represented by a predetermined short code, and thus, theefficiency of the lossless compression coding of the difference signalcan be enhanced.

The coordinate bit sequence is losslessly compression-coded. As thelossless compression coding, an entropy coding, such as Huffman codingand arithmetic coding, can be used which takes advantage of theoccurrence or frequent occurrence of a sequence in which the same sign(1 or 0) successively appears.

When decoding, the codes resulting from the lossless compression codingare decoded, and the inverse transformation of bit arrangement isperformed on the decoded signal. That is, the coordinate bit sequencesare converted into the amplitude bit sequences for each frame, and theresulting difference signals are reproduced sequentially. In addition,the codes resulting from the lossy compression coding are decoded, thedecoded signal and the reproduced difference signal are summed together,and then, the sum signals for each frame are linked togethersequentially, thereby reproducing the original digital signal sequence.

Besides, there are known a variety of lossless coding methods for audioor visual information that permit no distortion. For example, a losslesscoding method for music information is disclosed in “LosslessCompression of Digital Audio” by Mat Hans, Ronald W. Schafer et al.,IEEE SIGNAL PROCESSING MAGAZINE, July 2001, pp. 21-32. Any conventionalmethods are compression coding methods that use a signal waveformdirectly as a PCM signal.

However, in music recording studios, a waveform is sometimes recordedand retained in the floating-point format. Any value in thefloating-point format is separated into a sign, an exponent and amantissa. For example, in the IEEE 754 standard floating-point formatshown in FIG. 1, any value consists of 32 bits including 1 bit for sign,8 bits for exponent and 23 bits for mantissa in the descending order ofsignificance. Denoting the sign by S, the value represented by the 8bits for exponent by a decimal number E and the binary number formantissa by M, the value in the floating-point format can be representedin the sign and magnitude binary notation as:(−1)^(S)×1.M×2^(E-E0)  (1)According to the IEEE 754 standard, E₀ is defined as E₀=2⁷−1=127, sothat the “E−E₀” in the expression (1) can assume any value fallingwithin the range:

−127≦E−E₀≦128.

In the case where sound, music or image information is represented by adigital signal sequence in the floating-point format, the bit sequencecomposed of “0”s and “1”s is likely to be random because of thecharacteristics of the floating-point format. Thus, even if the bitarrangement transformation described above is performed, the entropycompression coding or the like cannot be expected to provide a highcompression ratio. Furthermore, the sample sequence in thefloating-point format significantly differs from the original analogwaveform, so that there is no redundancy due to correlation betweensamples. Therefore, even if the lossless predictive coding methoddisclosed in the above-described literature by Mat Hans, Ronald W.Schafer et al. is applied, a higher compression ratio cannot beexpected.

Patent literature 1: Japanese Patent Application Kokai Publication No.2001-44847

DISCLOSURE OF THE INVENTION Problem to be Solved by the Invention

An object of the present invention is to provide a lossless codingmethod for a digital signal in the floating-point format that permits nodistortion and has a high compression ratio, a corresponding decodingmethod, apparatus therefor and programs therefor.

Means to Solve the Problem

A lossless coding method and a lossless coding apparatus for a digitalsignal in a floating-point format according to the present inventioninvolve converting a first digital signal sample in the floating-pointformat into a second digital signal sample in an integer format,losslessly compressing the second digital signal sample in the integerformat to produce a code sequence, producing a difference signal thatcorresponds to the difference between the second digital signal samplein the integer format and the first digital signal sequence in thefloating-point format, and outputting the code sequence and differenceinformation corresponding to the difference signal as a coding result.

In this way, by converting digital signal samples in the floating-pointformat into digital signal samples in the integer format, whichapproximate to the waveform of the original analog signals, highlyefficient compression can be achieved by a compression method thateliminates a redundancy due to correlation between signal samples.

A decoding method and a decoder for a digital signal in a floating-pointformat according to the present invention involve decoding and expandinga code sequence to produce a first digital signal sample in an integerformat, producing a difference signal based on difference information,converting the first digital signal sample in the integer format into asecond digital signal sample in the floating-point format, and combiningthe first digital signal sample in the floating-point format and thedifference signal to produce a third digital signal sample in thefloating-point format.

Effects of the Invention

According to the present invention, a digital signal sample sequence inthe floating-point format can be efficiently losslessly compressed. Inaddition, a typical compression-coding module designed for a samplesequence in the integer format can be used to handle both the integerformat and the floating-point format, without increasing significantlythe scales of the processing apparatus and the program.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a format of 32-bit floating point representation accordingto the IEEE-754;

FIG. 2 is a functional diagram of a coder according to a firstembodiment of the present invention;

FIG. 3 is a diagram for illustrating an operation of an integerformatting part 12 shown in FIG. 2;

FIG. 4 is a flowchart showing a procedure in the integer formatting part12 shown in FIG. 2;

FIG. 5 is a functional diagram of a decoder according to the firstembodiment of the present invention;

FIG. 6 is a functional diagram of a coder according to a secondembodiment of the present invention;

FIG. 7 is a flowchart showing a digit adjustment procedure;

FIG. 8 is a functional diagram of a decoder according to the secondembodiment of the present invention;

FIG. 9 is a functional diagram of a variation of the coder according tothe second embodiment of the present invention;

FIG. 10 is a functional diagram of a variation of the decoder accordingto the second embodiment of the present invention;

FIG. 11 is a diagram for illustrating subtractions (additions) of valuesin the floating-point format performed separately for the exponent andthe mantissa thereof;

FIG. 12 is a functional diagram of a coder for illustrating a codingmethod according to another embodiment of the present invention;

FIG. 13 is a functional diagram of a decoder for illustrating a decodingmethod according to another embodiment of the present invention; and

FIG. 14 is a diagram for illustrating a computer on which a coder and adecoder according to the present invention are implemented.

BEST MODES FOR CARRYING OUT THE INVENTION First Embodiment

FIG. 2 shows a functional configuration of a coder according to anembodiment of the present invention. A coder 100 according to thisembodiment comprises an integer formatting part 12, a compressing part13, a difference producing part 14, and a compressing part 17. Theinteger formatting part 12 has a digit calculating part 12A, and thedifference producing part 14 comprises a floating-point formatting part15 and a subtraction part 16. As a sequence of digital signal samples Xin the 32-bit floating-point format, a signal source 11 outputs a musicsignal sample sequence. Each of the digital signal samples X is producedby performing a processing, such as transformation, amplitudeadjustment, effect addition and mixing, on a raw signal recorded in the24-bit integer format and converting the resulting signal having afractional part as a result of the processing into the floating-pointformat, or produced by converting a raw signal recorded in the 24-bitinteger format into the 32-bit floating-point format and performing suchprocessing as described above on the resulting signal. Here, the integervalue may be directly converted into a floating-point value, ornormalization may be performed so that an integer 32768 is normalized to1.0. The following description will be made assuming the former case.However, the two cases differ only in the value of the exponential part,and the present invention can be applied to both the cases.

Digital signal samples X in the floating-point format are input to theinteger formatting part 12, and each sample is converted into a digitalsignal sample Y in the integer format. As described above, in theexample described above, the digital signal sample X is often derivedfrom a raw signal in the 24-bit integer format through a processing,such as transformation, amplitude adjustment and effect addition, sothat the amplitude of the signal typically does not vary significantly.Thus, the integer formatting part 12 can simply convert thefloating-point number into an integer by rounding of fractional part. Inthe following, a case where truncation is performed as rounding will bedescribed with reference to FIG. 3. While the number of digits of theinteger format may be 16 bits, 20 bits or the like, it will be assumedin the following description that the number of digits of the integerformat is 24 bits.

If the exponent value E is 147, for example, the bit adjacent thedecimal point on its higher order side is the 20th bit (=147−127) fromthe MSB in the mantissa M. As shown in FIG. 3A, in the sign andmagnitude binary notation, the 20 most significant bits (M₁) in the23-bit mantissa M constitute the integer part, and the remaining threeleast significant bits (M₂) constitute the fractional part below thedecimal point. Therefore, as shown in 3B, if the mantissa M is shiftedby three bits toward the least significant bit position so that theleast significant bit in the integer part (M₁) is positioned at theleast significant bit in the entire 23-bit mantissa, overflow of thethree bits (M₂) below the decimal point occurs, and thus, the three bitsare truncated. Then, the least significant bit in the three mostsignificant bits having been made unoccupied (“000” in this example) bysuch shifting (that is, the 21st bit from the least significant bit) isset at 1, which corresponds to “1” of “1.M” in the expression (1),thereby providing a truncated integer value (see FIG. 3C).Alternatively, “1” may be added before the most significant bit in the23 bits before shifting, and the resulting 24 bits may be shifted bythree bits.

Furthermore, the resulting integer value is converted into a two'scomplement notation. That is, the sign bit S of each digital sample X inthe floating-point format is uses as it is as the most significant bit.As for the other 23 bits, if the sign S is “0” (positive), the 23 bitsshown in FIG. 3C are used as they are, and if the sign S is “1”(negative), the 23 bits are logically inverted as shown in FIG. 3D, thatis, the values “0” and “1” are interchanged, and then, “1” is added tothe least significant bit. Here, as the most significant bit, the signbit S is used as it is. In this way, a 24-bit integer represented in thecomplement notation is obtained as shown in FIG. 3E.

The above description has been made generally on the assumption that themantissa M contains 0 or more bits corresponding to the fractional part,and a 32-bit digital signal sample in the floating-point format isconverted into a 24-bit digital signal sample in the integer format.However, for example, in the case where a plurality of raw signals inthe 24-bit integer format are mixed for processing, one sample may havean amplitude value that is significantly greater than the maximum valuethat can be represented by 24 bits. In such a case, as an exceptionalprocessing, in the example described above, the value of the exponent Eis limited to 150 (=127+23), and the 23 bits of the mantissa M areconverted directly into the two's complement notation and used as adigital signal in the 24-bit integer format.

The integer formatting part 12 performs a processing shown in FIG. 4,for example. First, it is determined whether the exponent E is greaterthan 150 or not, that is, whether the integer part is constituted by 23or more bits or not (S1). If the integer part is constituted by lessthan 23 bits, the digit calculating part 12A determines the number ofdigits of the integer value (n=E−E₀) and outputs the result (S2). Then,the mantissa M is shifted by (23-n) bits toward the least significantposition to make overflow of the fractional part occur, and “1” isplaced at the (n+1)th bit position viewed from the least significant bitof the resulting integer part composed of n bits (S3). Then, “0”s aresupplemented at the remaining bit positions preceding the (n+1)th bit sothat the whole mantissa is composed of 23 bits, and based on the signbit S, the resulting 23 bits are converted into a 24-bit integer in thetwo's complement notation, thereby providing one digital value sample inthe integer format (S5). Specifically, the sign bit S is used as themost significant bit as it is. As the remaining 23 bits, if the sign Sis “0” (positive), the 23 bits beginning with the least significant bitof the integer part resulting from the shifting in step S3 are used, andif the sign S is “1” (negative), the 23 bits beginning with the leastsignificant bit of the integer part resulting from the shifting areinverted except for the most significant bit and used. If the exponent Eis equal to or greater than 150 in step S1, the exponent E is limited to150 in step S4, and then, the process continues to step S5. In the abovedescription, the mantissa M is shifted by (23-n) bits to provide a24-bit integer value sample in the sign and magnitude binary notation.Alternatively, most significant n (=E−E₀) bits may be extracted from themantissa M, “1” be added at the top of the n bits to make the number ofbits (n+1), (22-n) “0”s be added at the top of the (n+1) bits to makethe number of bits 23, and then the sign bit S be added at the top ofthe 23 bits to make the number of bits 24.

In the above description, the integer formatting part 12 performsrounding of the fractional part below the decimal point by truncation instep S3 in FIG. 4. However, round-up may be performed, or truncation orround-up may be selectively performed depending on whether the firstdecimal place is “1” or “0”. If a carry occurs due to the rounding, “1”is added to the least significant bit of the integer part after(23-n)-bit shifting. Furthermore, if a carry occurs at the mostsignificant bit of the integer part as a result of the addition, asshown by a dashed line in FIG. 2, 1-bit information indicating theoccurrence of the carry is coded, and the coded information istransmitted as auxiliary information Cd.

A sequence of the digital signal sample Y in the integer format producedby the integer formatting part 12 is, as an integer value,compression-coded in the compressing part 13 by an efficient losslesscompression method using correlation with a waveform or the like, andthen output as a code sequence Ca. For example, as disclosed in theabove-described literature by Mat Hans et al., the lossless compressionin the compressing part 13 may be achieved by determining the differencebetween the value of each sample and a predicted value (integer value),changing the bit arrangement of a sequence of such differences asdescribed in the section “BACKGROUND ART”, and then performing theentropy coding on the resulting sequence, that is, the coordinate bitsequence. That is, the sequence of the digital signal samples Y in theinteger format approximates to the original analog signal waveform fromwhich the sequence of the digital signal samples X output from thesignal source 11 has been derived. Therefore, the sequence of thedigital signal samples X can be efficiently losslessly compression-codedby eliminating, by prediction or transformation, the redundancy due tothe correlation between the signal samples.

In addition, a difference signal (error) ΔX, which indicates thedifference between the digital signal sample Y in the integer format andthe corresponding digital signal sample X in the floating-point formatoutput from the signal source 11, is produced in the differenceproducing part 14. In this example, the digital signal sample Y in theinteger format is converted again into a digital signal sample X′ in thefloating-point format in the floating-point formatting part 15, and theresulting digital signal sample X′ in the floating-point format issubtracted from the original digital signal sample X in thefloating-point format in the subtraction part 16, thereby producing thedifference digital signal ΔX in the floating-point format.

In the case where the digital signal sample in the integer format iscomposed of 24 bits, the floating-point formatting part 15 can convertthe digital signal into a digital signal in the floating-point formatcomposed of 32 bits without any ambiguity or exception. As describedabove, the exponent E of the original digital signal sample X in thefloating-point format is likely to be equal to or less than 149, and insuch a case, the difference digital signal ΔX indicating the differencebetween the digital signal sample X′ and the original digital signalsample X in the floating-point format equals to the value of thefractional part of the original digital signal sample X.

The difference signal ΔX from the difference producing part 14 islosslessly compression-coded in the compressing part 17 and, then,output therefrom as difference information Cb. As described above, thedifference signal ΔX equals to the value of the fractional part of theoriginal digital signal sample, and if the number of digits below thedecimal point of the mantissa of the difference signal is small, thedifference signal can be efficiently losslessly compression-coded by theentropy coding or the like. In order to raise the compressionefficiency, the compressing part 17 may separate the differences for theexponent E and the mantissa M, perform an appropriate losslesscompression coding on each of the differences and output the resultsseparately as code sequences Cb1 and Cb2, respectively. In this case,the exponent E is the same as the exponent of the sample X′ and can befound by converting the signal sample Y resulting from decoding of thecode Ca on the receiving side into the signal sample X′ in thefloating-point format, so that the exponent E need not be transmitted.In other words, only the difference for the mantissa M has to be codedand output as the difference information Cb2.

The number of digits below the decimal point of the difference signal ΔXis sometimes large. In such a case, the efficiency of coding may bereduced. Thus, the difference signal ΔX may be output as it is, withoutbeing coded, as the difference information. Alternatively, comparisonbetween the difference signal ΔX and the coded difference signal may bemade in terms of information quantity, and the one with the smallerquantity of information may be chosen.

As described above, in the exceptional case where the mantissa of thedigital signal sample X in the floating-point format is equal to orgreater than 150 (E≧150), the integer formatting part 12 transmits anexception signal y, which indicates that the exponent E is limited to150, to the difference producing part 14, and the difference producingpart 14 produces, as a difference signal ΔX, the exponent difference(E−150), which is the difference between the value 150 of the exponentand the value of the exponent E of the digital signal sample X, and thedifference for the mantissa M (in which all the bits are set at “0”).The compressing part 17 performs a lossless compression coding on thedifference signal ΔX and outputs the resulting code as the differenceinformation Cb. In this case, since all the bits of the difference forthe mantissa are “0”, the difference for the mantissa may not betransmitted, and only the exponent difference may be coded, and theresulting code be output as the difference information Cb.

FIG. 5 shows a decoder 200 according to this embodiment of the presentinvention, which is associated with the coder 100 shown in FIG. 2.

The input code sequence Ca is losslessly expansion-decoded in anexpansion part 21. This lossless expansion decoding corresponds to thelossless compression coding performed in the compressing part 13 shownin FIG. 2 and is to perform a reverse processing of the losslesscompression coding. Therefore, this lossless expansion decoding producesa sequence of digital signal samples Y in the 24-bit integer format.

The digital signal sample Y in the integer format is converted into adigital signal sample X′ in the 32-bit floating-point format by thefloating-point formatting part 22. On the other hand, the inputdifference information Cb is losslessly expansion-decoded in anexpansion part 23. This lossless expansion decoding corresponds to thelossless compression performed in the compressing part 17 shown in FIG.2. Therefore, this lossless expansion decoding produces a differencesignal ΔX.

Since the difference signal equals to the value of the fractional partat the least significant bit position(s), it is inserted to thecorresponding least significant bit position(s) of the mantissa of thedigital signal sample X′ in the floating-point format in a combiningpart 24, and thus, the digital signal sample X in the floating-pointformat is reproduced. In the case where the coder 100 shown in FIG. 2outputs the difference signal ΔX without performing compression coding,the difference signal ΔX received by the decoder 200 is transmitted tothe combining part 24 as it is, and the same combination process isperformed.

Second Embodiment

FIG. 6 is a functional diagram of a coder 100 according to a secondembodiment of the present invention, in which the parts corresponding tothose in FIG. 2 are denoted by the same reference numerals as in FIG. 2.According to the second embodiment, a sample sequence dividing part 31divides a sequence of digital signal samples X in the floating-pointformat into blocks of predetermined number of samples or frames, and adigit adjusting part 32 performs digit adjustment on the exponent E on adivisional unit basis so that the number of digits of a digital signalsample Y in the integer format falls within an appropriate range, thatis, the number of digits of a digital signal sample in the integerformat converted from the digital signal sample X equal to or less than24, as described below:

(a) If a digital signal sample X in the floating-point format that is solarge in amplitude as to have an exponent E greater than 150 isconverted into a 24-bit digital signal sample Y in the integer format,the information represented by one or more least significant bits of themantissa M of the digital signal sample X would be lost. Besides, if adigital signal sample X in the floating-point format that is so large onamplitude as to have an exponent E approximating to but less than 150 isconverted into a digital signal sample Y in the integer format, thedigital value of the sample would often exceed the 24-bit integer value.In order to avoid these, for each divisional unit, the digit adjustingpart 32 subtracts adjustment information ΔE from the exponent E of thedigital signal sample X to make the value of the exponent E equal to orless than 150.

(b) If a digital signal sample X in the floating-point format that has asmall amplitude is converted into a 24-bit digital signal sample Y inthe integer format, and most significant 21 to 23 bits except for thesign bit S, which is the most significant bit, of the 24 bits of thedigital signal sample Y in the integer format are all “0”, the amplitudecan be represented by only about 2 bits. Thus, the waveform of thesequence of the digital signal samples Y in the integer format does notapproximate to the analog waveform, and therefore, the advantage of theconversion into the digital signal sample Y in the integer format, thatis, the advantage of the lossless compression coding with a highcompression ratio is not provided. In addition, in the case where theamplitude value of the digital signal sample Y in the integer format isrepresented by about two least significant bits thereof, if the signalsample Y is converted in to a digital signal in the floating-pointformat, almost all the bits of the mantissa M of the resulting digitalsignal are “0”. For example, all of them are “0”, or all of them exceptfor the most significant bit, which is “1”, are “0”. On the other hand,the mantissa M of the input digital signal sample X in thefloating-point format can assume a great value even if the amplitude ofthe signal sample X is small. Therefore, the mantissa M of thedifference signal ΔX in the floating-point format, which corresponds tothe error (difference) from that of the digital signal sample X in thefloating-point format, has a large amplitude. That is, the number ofbits that are “0” for all the samples is reduced, so that thecompression efficiency cannot be raised.

In order to avoid such a problem, the digit adjusting part 32 addsadjustment information ΔE to each exponent E on a divisional unit basis,so that as much information represented by the mantissa M as possible iscontained in the digital signal sample Y in the integer format. In thiscase, the number of bits of one sample resulting from the conversioninto the integer format should not be greater than 24.

The adjustment information ΔE (an integer of any sign) in the digitadjusting part 32 can be changed for each divisional unit. The digitadjusting part 32 finds the maximum one of the exponents E in eachdivisional unit and determines the adjustment information ΔE for thedivisional unit so that as much information represented by the mantissaM as possible can be utilized while keeping the number of bits of onesample in the integer format equal to or less than 24.

FIG. 7 shows a procedure of the digit adjustment performed by the digitadjusting part 32. This drawing shows a case where the sample sequencedividing part 31 divides a sample sequence by N_(F) samples, and thedigit adjustment is performed for N_(F) samples as a unit.

In step S1, N_(F) input samples are received, and in step S2, i=1 andΔE₀=0 are initially set.

In step S3, 150 is subtracted from the exponent E_(i) of the i-th sampleto produce the difference ΔE_(i).

In step S4, it is determined whether or not the difference ΔE_(i) isgreater than the proceding difference ΔE_(i-1). If the difference ΔE_(i)is not greater than the difference ΔE_(i-1), the process continues tostep S6.

If the difference ΔE_(i) is greater than the difference ΔE_(i-1) in stepS5, the difference ΔE_(i) is regarded as the maximum difference ΔE_(max)and temporarily saved.

In step S6, it is checked whether or not i=N_(F). If i is not equal toN_(F), the number of i is incremented by 1 in step S7, and then, theprocess returns to step S3.

If it is determined that i=N_(F) in step S6, in step S8, the maximumdifference ΔE_(max) is read out, and it is checked whether or not thedifference ΔE_(max) is equal to or greater than 1. If the differenceΔE_(max) is equal to or greater than 1, the process continues to stepS10.

If the difference ΔE_(max) is less than 1 in step S8, in step S9, it ischecked whether or not the difference ΔE_(max) is equal to or less than−K, where K is a predetermined integer equal to or greater than 1. Ifthe difference ΔE_(max) is equal to or less than −K, the processcontinues to step S10.

In step S10, using the maximum difference ΔE_(max) as adjustmentinformation ΔE, the digit of each of the N_(F) samples is adjustedaccording to a relation of E_(i)′=E_(i)−ΔE, the resulting N_(F) samplesadjusted in digit are transmitted to the integer formatting part 12, andthen the process returns to step S1. If the difference ΔE_(max) isgreater than −K in step S9, the process returns to step S1.

Thus, if the difference ΔE_(max) is equal to or greater than 1 in stepS8, it means that the amplitude of the digital signal sample X is large,and the exponent E is greater than 150. If the difference ΔE_(max) isequal to or less than −K in step S9, it means the amplitude of thedigital signal sample X is small, and the degree of waveformapproximation is poor. For example, K can be set at a value from 20 to22.

As in the first embodiment, the digital signal sample in thefloating-point format having been adjusted in digit in this way isconverted into a digital signal sample Y in the integer format in theinteger formatting part 12, and the sequence of such signal samples Y islosslessly compression-coded in the compressing part 13 to produce acode sequence Ca.

In order that decoding can reproduce losslessly the original digitalsignal sample X in the floating-point format before coding, an auxiliarycoding part 33 codes the adjustment information ΔE including the sign,which indicates addition or subtraction, to produce an auxiliary codesequence Cc.

In the embodiment shown in FIG. 6, a reverse digit adjusting part 34 inthe difference producing part 14 performs a reverse digit adjustment, bythe adjustment information ΔE for the corresponding divisional unit, onthe digital signal sequence Y in the integer format. That is, if thedigit adjusting part 32 adds negative adjustment information ΔE (if ΔEis negative in step S10), the reverse digit adjusting part 34 shifts the23 bits, excluding the most significant bit, of the correspondingdigital signal sample toward the least significant position by ΔE bits,and fills the bit positions made unoccupied by the shifting with “0”s.If the digit adjusting part 32 adds positive adjustment information ΔE(if ΔE is positive in step S10), the reverse digit adjusting part 34shifts the 23 bits, excluding the most significant bit, of thecorresponding digital signal sample toward the most significant positionby ΔE bits, in other words, makes overflow of ΔE bits occur, and fillsthe least significant bit positions made unoccupied by the shifting with“1”s to make the number of bits 23+ΔE.

The digital signal sample Y in the integer format having beenreverse-adjusted in digit is converted into a digital signal sample X′by the floating-point format in the floating-point formatting part 15.The difference ΔX between the digital signal sample X′ in thefloating-point format and the original digital signal sample X in thefloating-point format is determined by the subtraction part 16. Thedifference signal ΔX is losslessly compression-coded by the compressingpart 17, and the resulting code sequence Cb is output. In thisembodiment again, only the fractional part of the difference signal ΔXmay be output as it is as the difference information, rather thancompression-coding the difference signal ΔX. As shown by a dashed linein FIG. 6, the sample sequence dividing part 31 may be provided so as tosupply the divisional sequences of digital signal samples X in thefloating-point format to both the digit adjusting part 32 and thesubtraction part 16.

FIG. 8 shows a functional arrangement of a decoder 200 associated withthe coder 100 shown in FIG. 6, whose parts corresponding to those of thedecoder 200 shown in FIG. 5 are denoted by the same reference numerals.An expansion part 21 losslessly expansion-decodes the code sequence Caon a divisional-unit basis, thereby producing a sequence of digitalsignal samples Y in the integer format. In this embodiment, an auxiliarydecoding part 41 decodes the auxiliary code Cc to produce adjustmentinformation ΔE. Based on the adjustment information ΔE, a digitadjusting part 42 performs digit adjustment, by E_(i)+ΔE, on the digitalsignal samples Y in the integer format. If the adjustment information ΔEis positive, the bits of each digital signal sample Y is shifted towardthe most significant bit position by ΔE bits. If the adjustmentinformation ΔE is negative, the bits of each digital signal sample Y isshifted toward the least significant bit position by ΔE bits. In thisprocess, as with the reverse digit adjusting part 34 shown in FIG. 6,the bit positions made unoccupied by the shifting are filled with “1”sor “0”s.

The digital signal samples in the integer format from the digitadjusting part 42 are converted into digital signal samples X′ in thefloating-point format by the floating-point formatting part 22. Eachdigital signal sample X′ and a difference signal ΔX in thefloating-point format, which is derived from the difference informationCb through reverse expansion decoding by an expansion part 23, arecombined together by the combining part 24. As required, a coupling part43 converts the consecutive digital signals into a sample sequence,thereby reproducing the sequence of digital signal samples X in thefloating-point format.

Modified Embodiment

As shown in FIG. 9, in which the parts corresponding to those in FIG. 6are denoted by the same reference numerals, without performing thereverse digit adjustment of the digital signal sample Y, the digitalsignal sample Y in the integer format may be converted into a digitalsignal sample in the floating-point format by the floating-pointformatting part 15, and the difference between the resulting digitalsignal sample in the floating-point format and the digital signal samplein the floating-point format having been adjusted in digit by the digitadjusting part 32 be determined, thereby producing the difference signalΔX in the floating-point format. That is, as far as the differenceproducing part 14 determines, in the floating-point format, thedifference signal between the original digital signal sample X in thefloating-point format and the digital signal sample Y in the integerformat, any of the arrangements shown in FIGS. 2, 6 and 9 can be used.

Associated with the coder shown in FIG. 9, the decoder 200 shown in FIG.10 may reproduce the digital signal sample X in the floating-pointformat by first converting the digital signal sample Y in the integerformat, which has been losslessly expansion-decoded by the expansionpart 21, into a digital signal sample in the floating-point format bythe floating-point formatting part 22, combining together the resultingdigital signal sample and the difference signal ΔX in the floating-pointformat losslessly expansion-decoded by the expansion part 23 by thecombining part 24, and then, adjusting the digit of the exponent E ofthe combination digital signal by the digit adjusting part 42 using theadjustment information ΔE decoded by the auxiliary decoding part 41.

The above description has been made on the assumption that thesubtraction part 16 in the coder performs a typical floating-pointsubtraction, that is, if the exponents E of the relevant two values aredifferent, mantissa subtraction is performed by adjusting the digit ofthe smaller exponent to that of the larger exponent. In this case, thereis a possibility that a lower digit of the mantissa of the value havingthe smaller exponent E is lost, so that the decoder cannot reproduceaccurately the original digital signal sample X in the floating-pointformat. Thus, a special processing is required. The same applies to theaddition performed by the combining part 24 in the decoder.

To solve the problem, the exponent E and the mantissa M are separatelycalculated without performing digit adjustment. As shown in FIG. 11, thedifference between the exponent E of the digital signal sample X and thedigital signal sample X′ is determined by an exponent subtraction part16E, the difference between the mantissa M of the digital signal sampleX and the mantissa M of the digital signal sample X′ is determined by amantissa subtraction part 16M, and the result of the subtractionperformed by the exponent subtraction part 16E is used as the exponent Eof the difference signal ΔX, and the result of the subtraction performedby the mantissa subtraction part 16M is used as the mantissa M of thedifference signal ΔX.

As shown by parentheses in FIG. 11, addition is performed by thecombining part 24 in the decoder is the same manner. That is, anexponent addition part 24E sums the exponent E of the difference signalΔX and the exponent E of the digital signal sample X′, a mantissaaddition part 24M sums the mantissa M of the difference signal ΔX andthe mantissa M of the digital signal sample X′, and the result of theaddition performed by the exponent addition part 24E is used as theexponent E of the digital signal sample X, and the result of theaddition performed by the mantissa addition part 24M is used as themantissa M of the digital signal sample X.

In this case, even if the absolute value of the floating-point value isgreater than the maximum value in the integer format, the floating-pointvalue can be converted into the integer format by limiting the absolutevalue thereof to the maximum value of the integer. Since the mantissainformation and the exponent information are separately retained, allthe bits of the floating-point value can be reproduced, so that anyexceptional processing is not required.

Therefore, the subtraction part 16 shown in FIGS. 2, 6 and 9 may performa typical floating-point subtraction, which involves digit adjustment,or perform subtractions separately for the exponent and the mantissa.Similarly, the combining part 24 shown in FIGS. 5, 8 and 10 may performa typical floating-point addition, which involves digit adjustment, orperform additions separately for the exponent and the mantissa.

As shown in FIG. 12, the sampling frequency of the digital signal ampleX in the floating-point format may be down-converted to a lowerfrequency by a down-sampling part 36, the resulting digital signalsample in the floating-point format at the lower sampling frequency maybe converted into a digital signal sample Y in the integer format by theinteger formatting part 12, the digital signal sample Y may be suppliedto the compressing part 13 and an up-sampling part 37, where up-samplingis performed to convert the digital signal sample Y into a digitalsignal sample in the integer format at the same sampling frequency asthe digital signal sample X in the floating-point format, and theresulting digital signal sample in the integer format may be supplied tothe floating-point formatting part 15 and converted into a digitalsignal sample X′ in the floating-point format.

Such down-sampling may be performed on the digital signal sample in theinteger format output from the integer formatting part 12, instead ofthe input to the integer formatting part 12. That is, as shown by adashed-line block 36 in FIG. 12, the down-sampling part 36 may beinserted at the output side of the integer formatting part 12. In anycase, on the decoder side, as shown in FIG. 13, the digital signalsample Y in the integer format decoded by the expansion part 21 isup-sampled by an up-sampling part 45 so that the sampling frequencythereof is converted to the same sampling frequency as the digitalsignal sample input to the down-sampling part 36 in the coder shown inFIG. 12, and then supplied to the floating-point formatting part 22.

Such a down-sampling part 41 is provided in the case where it canimprove the compression efficiency of the entire system. If the factthat the compression ratio is improved is previously known from thedigital signal sample Y output from the signal source 11, thedown-sampling rate in the down-sampling part 41 can be fixed. However,if only some blocks of digital signal samples X in one sequence requiredown-sampling, or if it is preferred that the down-sampling rate ischanged for each block, as shown by a dashed-line in FIG. 12, a samplesequence dividing part 31 is provided to divide the sequence of digitalsignal samples X in the floating-point format into blocks of apredetermined number of samples. For each of the divisional blocks, anevaluation part 38 evaluates the case where down-sampling is performedand the case where down-sampling is not performed in terms ofcompression efficiency of the divisional block, that is, in terms of sumof the number of bits of the code Ca output from the compressing part 13and the number of bits of the code Cb output from the compressing part17 to determine which of the two cases provides a smaller sum,determines whether to perform down-sampling in the down-sampling part 36or whether to increase or decrease the sampling frequency in order toprovide a higher compression efficiency, that is, to make the sum of thenumber of bits of the code Ca and the number of bits of the code Cb, andoutputs the codes Ca and Cb that correspond to the better or best case.Besides, an auxiliary coding part 39 outputs, as an auxiliary code Cd, acode that indicates whether the code Ca to be output has beendown-sampled or not or auxiliary information that indicates thedown-sampling rate.

On the other hand, in the decoder, as shown in FIG. 13, an auxiliarydecoding part 46 decodes the auxiliary code Cd. Based on the decodedauxiliary information, up-sampling is performed at a predetermined rateor is not performed by an up-sampling part 45. Alternatively, theup-sampling part 45 performs up-sampling at an up-sampling ratespecified by the decoded auxiliary information.

Similarly, in order to raise the entire compression efficiency, when thedigital signal sample X in the floating-point format is converted intothe digital signal sample Y in the integer format in the coder, theconversion precision may be reduced by intention. For example, thedigital signal sample X may be converted into a digital signal sample inthe 16-bit integer format. That is, as shown by parentheses in FIG. 12,the quantization precision per sample (the number of bits representingthe amplitude thereof) of the digital signal sample X in thefloating-point format is reduced by the precision adjusting part 36.More specifically, for example, when the exponent E is 150, the exponentE is reduced to 142 if the sign S is “0” (positive), and the exponent Eis increased to 158 if the sign S is “1” (negative). The digital signalsample in the floating-point format having been converted in precisionis converted into the digital signal sample Y in the integer format bythe integer formatting part 12. The digital signal sample Y is suppliedto the compressing part 13 and a reverse precision-adjusting part 37,where the digital signal sample Y is converted into a digital signalsample in the integer format whose quantization precision (number ofbits representing the amplitude) is the same as that of the digitalsignal sample X in the floating-point format, and the digital signalsample in the integer format having been adjusted in precision issupplied to the floating-point formatting part 15 and converted into adigital signal sample X′ in the floating-point format.

On the decoder side, the digital signal sample Y in the integer formathaving been expansion-decoded by the expansion part 21 is adjusted inprecision, by the precision adjusting part 45, by a quantity equal tothat of precision adjustment performed by the reverseprecision-adjusting part 37 in the coder, and then supplied to thefloating-point formatting part 22. While the precision adjustment can beperformed in a fixed manner, as with the adjustment of samplingfrequency, the evaluation 38 may determines whether to perform precisionadjustment on a divisional-block basis or to what extent the precisionadjustment is performed, in order to improve the compression efficiency.In such a case, the auxiliary code Cd concerning the precisionadjustment is output. On the decoder side, if the auxiliary informationdecoded by the auxiliary decoding part 46 indicates only whether toperform precision adjustment, and if the precision adjustment is to beperformed, the precision adjusting part 45 performs precisionadjustment, or if the decoded auxiliary information specifies anadjustment quantity, the precision adjusting part 45 adjusts thequantization precision by the specified adjustment quantity.

On the coder side, two or all of the digit adjustment, the adjustment ofsampling frequency and the adjustment of quantization precisiondescribed above can be used. Accordingly, on the decoder side, two orthree of the digit adjustment, the adjustment of sampling frequency andthe adjustment of quantization precision are used.

[Implementation by computer] As shown in FIG. 14, the coder 100 shown inFIGS. 2, 6, 9 and 12 can be implemented by a computer 600 comprising aRAM 61, a CPU 62, a hard disk 63, a ROM 64, a transmitter/receiver 65, aCD/DVD drive 66 and an audio/video input/output part 67, which areinterconnected via a bus 68.

The ROM 64 stores a program for booting the computer, and the hard disk63 stores an operating system program for the computer. A program forexecuting a function of the coder 100 according to the present inventionis previously read into the hard disk 63 from a recording medium 71,such as CD-ROM and DVD, via the CD/DVD drive 66, or previouslydownloaded to the hard disk 63 through a communication line and thetransmitter/receiver 65.

The sequence of digital signal samples X in the floating-point format tobe coded is externally received at the audio/video input/output part 67,for example, and temporarily stored in the hard disk 63, which serves asa buffer. To start coding, a program for executing coding is read intothe RAM 61 from the hard disk 63, and the program is executed by the CPU62. Th result of coding, such as the codes Ca, Cb (or Z), Cc and Cd, maybe transmitted from the transmitter/receiver 65 to the outside via thecommunication line, or may be stored in a recording medium 65, such asCD and DVD, in the CD/DVD drive 66.

Similarly, in order to implement the decoder 200 shown in FIGS. 5, 8, 10and 13 by the computer shown in FIG. 14, a program for executing afunction of the decoder is stored in the hard disk 63, and a decodingprogram is executed on the codes Ca, CB (or Z), Cc and Cd received atthe transmitter/receiver 65 through the communication line. The resultof coding is output to a display unit 73 and a speaker 74 forreproduction.

The present invention can be applied not only to music signals but alsoto sound signals, image signals and the like.

1. A lossless coding method for a digital signal in a floating-pointformat, comprising: (a) a step of converting a first digital signalsample in the floating-point format into a second digital signal samplein an integer format; (b) a step of losslessly compressing a sequence ofsaid second digital signal samples in the integer format to produce afirst code sequence; (c) a step of producing a difference signal thatcorresponds to the difference between said second digital signal samplein the integer format and said first digital signal sample in thefloating-point format; and (d) a step of outputting said first codesequence and difference information corresponding to said differencesignal as a coding result.
 2. A lossless coding method for a digitalsignal in a floating-point format according to claim 1, in which saidstep (d) comprises a step of losslessly compressing said differencesignal to produce a second code sequence and a step of outputting saidsecond code sequence as the difference information corresponding to saiddifference signal.
 3. A lossless coding method for a digital signal in afloating-point format according to claim 1 or 2, in which said step (c)comprises a step of converting said second digital signal sample into athird digital signal sample in the floating-point format and a step ofproducing the difference between said first digital signal sample andsaid third digital signal sample as said difference signal.
 4. Alossless coding method for a digital signal in a floating-point formataccording to claim 1, in which said step (a) comprises: (a-1) a step ofdetecting, for each of blocks each containing a plurality of firstdigital signal samples in the floating-point format, the maximum valueof the exponents of the first digital signal samples; (a-2) a step ofadjusting the values of the exponents of the first digital signalsamples in the relevant block by an adjustment value determined based onthe detected maximum value so that the maximum of the numbers of digitsof integer values converted from the first digital signal samples in therelevant block be a predetermined value; (a-3) a step of converting thefirst digital signal samples in the floating-point format in therelevant block whose exponents have been adjusted into the integerformat; and (a-4) a step of coding adjustment information correspondingto said adjustment value to produce an auxiliary code, and saidauxiliary code is also output in said step (d).
 5. A lossless codingmethod for a digital signal in a floating-point format according toclaim 1 or 4, further comprising: a step of down-sampling said firstdigital signal sample or said second digital signal sample to make thesampling frequency of the digital signal sample used for producing saidfirst code sequence lower than the sampling frequency of said firstdigital signal sample; and a step of up-sampling the digital signalsample used for producing said first code sequence to convert thesampling frequency thereof to the same sampling frequency as said firstdigital signal sample, thereby producing a digital signal sample usedfor producing said difference signal.
 6. A lossless coding method for adigital signal in a floating-point format according to claim 1 or 4,further comprising: a step of converting the quantization precision ofeach first digital signal sample or each second digital signal sample tomake the quantization precision of the digital signal sample used forproducing said first code sequence lower than the quantization precisionof said first digital signal sample; and a step of raising thequantization precision of the digital signal sample used for producingsaid first code sequence to the quantization precision of said firstdigital signal sample, thereby producing a digital signal sample usedfor producing said difference signal.
 7. A decoding method for a digitalsignal in a floating-point format, comprising: (a) a step of decodingand expanding a first code sequence to produce a first digital signalsample in an integer format; (b) a step of producing a difference signalbased on difference information; (c) a step of converting said firstdigital signal sample in the integer format into a second digital signalsample in the floating-point format; and (d) a step of combining saidsecond digital signal sample in the floating-point format and saiddifference signal to produce a third digital signal sample in thefloating-point format.
 8. A decoding method for a digital signal in afloating-point format according to claim 7, in which said step (b)comprises a step of decoding and expanding said difference informationto produce said difference signal in the floating-point format.
 9. Adecoding method for a digital signal in a floating-point formataccording to claim 7 or 8, further comprising: a step of decoding anauxiliary code to produce adjustment information; and a step ofadjusting the digit of said first digital signal sample in the integerformat or said combined signal based on said adjustment information. 10.A decoding method for a digital signal in a floating-point formataccording to claim 7 or 8, further comprising: a step of up-samplingsaid first digital signal sample in the integer format to make thesampling frequency thereof equal to the sampling frequency of saiddifference signal, before converting said first digital sample into saidsecond digital signal sample in the floating-point format.
 11. Adecoding method for a digital signal in a floating-point formataccording to claim 7 or 8, further comprising: a step of converting thequantization precision of each first digital sample in the integerformat to the quantization precision of said difference signal, beforeconverting said first digital sample into said second digital signalsample in the floating-point format.
 12. A lossless coder for a digitalsignal in a floating-point format, comprising: an integer formattingpart that converts an input first digital signal sample in afloating-point format into a second digital signal sample in an integerformat; a first compressing part that losslessly compresses a sequenceof second digital signal samples in the integer format to produce afirst code sequence; and a difference producing part that produces adifference signal corresponding to the difference between said seconddigital signal sample in the integer format and said first digitalsignal sample in the floating-point format, in which said first codesequence and difference information corresponding to said differencesignal are output as a coding result.
 13. A lossless coder for a digitalsignal in a floating-point format according to claim 12, furthercomprising: a second compressing part that losslessly compresses saiddifference signal to produce a second code sequence and outputs thesecond code sequence as said difference information corresponding tosaid difference signal.
 14. A lossless coder for a digital signal in afloating-point format according to claim 12, in which said differenceproducing part comprises a floating-point formatting part that convertssaid second digital signal sample into a third digital signal sample inthe floating-point format and a subtracter that produces the differencebetween said first digital signal sample in the floating-point formatand said third digital signal sample as said difference signal.
 15. Alossless coder for a digital signal in a floating-point format accordingto claim 12, further comprising: a digit adjusting part that detects,for each of blocks each containing a plurality of first digital signalsamples in the floating-point format, the maximum value of the exponentsof the first digital signal samples and adjusts the values of theexponents of the first digital signal samples in the relevant block byan adjustment value determined based on the detected maximum value sothat the maximum of the numbers of digits of integer values convertedfrom the first digital signal samples in the relevant block be apredetermined value; and an auxiliary coding part that codes adjustmentinformation corresponding to said adjustment value to produce anauxiliary code and outputs the auxiliary code.
 16. A lossless coder fora digital signal in a floating-point format according to claim 12,further comprising: a down-sampling part that down-samples said firstdigital signal sample or said second digital signal sample to make thesampling frequency of the digital signal sample used for producing saidfirst code sequence lower than the sampling frequency of said firstdigital signal sample; and an up-sampling part that up-samples thedigital signal sample used for producing said first code sequence toconvert the sampling frequency thereof to the same sampling frequency assaid first digital signal sample, thereby producing a digital signalsample used for producing said difference signal in the floating-pointformat.
 17. A lossless coder for a digital signal in a floating-pointformat according to claim 12, further comprising: a precision adjustingpart that converts the quantization precision of each first digitalsignal sample or each second digital signal sample to make thequantization precision of the digital signal sample used for producingsaid first code sequence lower than the quantization precision of saidfirst digital signal sample; and a reverse precision adjusting part thatraises the quantization precision of the digital signal sample used forproducing said first code sequence to the quantization precision of saidfirst digital signal sample, thereby producing a digital signal sampleused for producing said difference signal.
 18. A decoder for a digitalsignal in a floating-point format, comprising: a first expansion partthat receives a first code sequence and decodes and expands the firstcode sequence to produce a first digital signal sample in an integerformat; a floating point formatting part that receives said firstdigital signal sample in the integer format and converts the firstdigital signal sample into a second digital signal sample in thefloating-point format; a combining part that receives a differencesignal based on difference information and combines said differencesignal and said first digital signal sample in the floating-point formatto produce a third digital signal sample in the floating-point format.19. A decoder for a digital signal in a floating-point format accordingto claim 18, further comprising: a second expansion part that decodesand expands said difference information to produce said differencesignal.
 20. A decoder for a digital signal in a floating-point formataccording to claim 18 or 19, further comprising: an auxiliary codingpart that decodes an auxiliary code to produce adjustment information;and a digit adjusting part that adjusts the digit of said first digitalsignal sample in the integer format or said combined signal based onsaid adjustment information.
 21. A decoder for a digital signal in afloating-point format according to claim 18 or 19, further comprising:an up-sampling part that up-samples said first digital sample in theinteger format to make the sampling frequency thereof equal to thesampling frequency of said difference signal, before converting saidfirst digital sample into said second digital signal sample in thefloating-point format.
 22. A decoder for a digital signal in afloating-point format according to claim 18 or 19, further comprising: aprecision adjusting part that converts the quantization precision ofeach first digital signal sample in the integer format to thequantization precision of said difference signal, before converting saidfirst digital signal sample into said second digital signal sample inthe floating-point format.
 23. A coding program that makes a computerexecute each step of a lossless coding method for a digital signal in afloating-point format according to claim
 1. 24. A decoding program thatmakes a computer execute each step of a decoding method for a digitalsignal in a floating-point format according to claim 7.